# encoding: utf-8
"""
    @author: 秦磊
    @contact: 1328298937@qq.com
    @file: suijidianming.py
    @time: 2017/6/29 10:18
    @desc:
"""
from random import choice

class person():
    def __init__(self,name,group):
        self.name = name
        self.group = group

class chooseperson():
    def __init__(self,persons):
        self.persons =  persons

    #随机点名
    def chooseone(self):
        try:
            while True:

                input()
                m = choice(self.persons)
                print(m.name,m.group)
                self.persons.remove(m)
        except Exception as e:
            print("所有人皆被点到过")

    #随机选组
    def choosegroup(self):
        m = choice(self.persons).group
        print(m)
        return m

    #随机点某个小组的人
    def chooseonefromgroup(self,group):
        newgroup = []
        for i in self.persons:
            if i.group == group:
                newgroup.append(i)
        m = choice(newgroup)
        print(m.name)

if __name__ == '__main__':
    person = [person('雷沛扬',"小能手"),
                person('李白康',"小能手"),
                person('张星月',"小能手"),
                person('杨言',"小能手"),
                person('邹宇婷','小花朵'),
                person('章丽君','小花朵'),
                person('秦磊','小花朵'),
                person('高建军','小花朵'),
                person('潘宝羽','小蜜峰'),
                person('谢思思','小蜜峰'),
                person('牟晓峰','小蜜峰'),
                person('岑谋春','小蜜峰'),
                person('郑洁','小菜鸟'),
                person('何欢','小菜鸟')]

    m = chooseperson(person)
    m.chooseone()
    # m.choosegroup()
    # m.chooseonefromgroup(m.choosegroup())
